package web.fabrimind.qc.service.impl;

import java.util.List;
import web.fabrimind.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import web.fabrimind.qc.mapper.QualityInspectionMapper;
import web.fabrimind.qc.domain.QualityInspection;
import web.fabrimind.qc.service.IQualityInspectionService;

/**
 * 质量检验Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-25
 */
@Service
public class QualityInspectionServiceImpl implements IQualityInspectionService 
{
    @Autowired
    private QualityInspectionMapper qualityInspectionMapper;

    /**
     * 查询质量检验
     * 
     * @param inspectionId 质量检验主键
     * @return 质量检验
     */
    @Override
    public QualityInspection selectQualityInspectionByInspectionId(Long inspectionId)
    {
        return qualityInspectionMapper.selectQualityInspectionByInspectionId(inspectionId);
    }

    /**
     * 查询质量检验列表
     * 
     * @param qualityInspection 质量检验
     * @return 质量检验
     */
    @Override
    public List<QualityInspection> selectQualityInspectionList(QualityInspection qualityInspection)
    {
        return qualityInspectionMapper.selectQualityInspectionList(qualityInspection);
    }

    /**
     * 新增质量检验
     * 
     * @param qualityInspection 质量检验
     * @return 结果
     */
    @Override
    public int insertQualityInspection(QualityInspection qualityInspection)
    {
        qualityInspection.setCreateTime(DateUtils.getNowDate());
        return qualityInspectionMapper.insertQualityInspection(qualityInspection);
    }

    /**
     * 修改质量检验
     * 
     * @param qualityInspection 质量检验
     * @return 结果
     */
    @Override
    public int updateQualityInspection(QualityInspection qualityInspection)
    {
        qualityInspection.setUpdateTime(DateUtils.getNowDate());
        return qualityInspectionMapper.updateQualityInspection(qualityInspection);
    }

    /**
     * 批量删除质量检验
     * 
     * @param inspectionIds 需要删除的质量检验主键
     * @return 结果
     */
    @Override
    public int deleteQualityInspectionByInspectionIds(Long[] inspectionIds)
    {
        return qualityInspectionMapper.deleteQualityInspectionByInspectionIds(inspectionIds);
    }

    /**
     * 删除质量检验信息
     * 
     * @param inspectionId 质量检验主键
     * @return 结果
     */
    @Override
    public int deleteQualityInspectionByInspectionId(Long inspectionId)
    {
        return qualityInspectionMapper.deleteQualityInspectionByInspectionId(inspectionId);
    }
}
